import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class HomeRootPage extends StatefulWidget{
  HomeRootPage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _HomeRootPageState createState() => _HomeRootPageState();

}

class _HomeRootPageState extends State<HomeRootPage> {




  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child:  WebView(
          initialUrl: 'https://www.baidu.com',
          javascriptMode: JavascriptMode.unrestricted,
          onWebViewCreated: (WebViewController webViewController) {
//            _controller.complete(webViewController);
          },
        )

      ),
       // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
